//
//  Bundle+Extesion.swift
//  Extensions
//
//  Created by yiwanjun on 2020/6/13.
//

import UIKit

public extension Bundle {
    
    /// 获取特殊bundle
    /// - Parameters:
    ///   - id: 指定名称的bundle
    ///   - cls: 根据 class 获取父 bundle
    convenience init?(id: String, cls: AnyClass){
        self.init()
        let bundle = Bundle(for: cls)
        if let url = bundle.url(forResource: id, withExtension: "bundle"){
            self.init(url: url)
        }
    }
}
